import React, { FC } from "react"
import {
  NavigationContainer,
  DefaultTheme,
  DarkTheme,
} from "@react-navigation/native"
import { ColorSchemeName } from "react-native"
import LinkingConfiguration from "./LinkingConfiguration"
import RootNavigator from "./components/RootNavigator"
/**
 * 导航管理
 * https://reactnavigation.org/docs/getting-started
 */
interface Props {
  colorScheme: ColorSchemeName
}

const Navigation: FC<Props> = (props: Props) => (
  <NavigationContainer
    linking={LinkingConfiguration}
    theme={props.colorScheme === "dark" ? DarkTheme : DefaultTheme}
  >
    <RootNavigator />
  </NavigationContainer>
)

export default Navigation
